package com.mocksamples.banksystem;

public class BankSystem {
	
	private CurrencyService currencyService;

	public BankSystem(CurrencyService service) {
		this.currencyService = service;
	}

	public void transfer(Account from, Account to, double amount) throws InsufficientFundsException {
		double rate = currencyService.conversionRate(from.currency(), to.currency());
		from.withdraw(amount);
		to.deposit(amount * rate);
	}

}
